import os
import sys
# print(sys.argv[0],sys.argv[1])
# hostname = "baidu.com"  # example
# hostname = "192.168.31.200"  # example
hostname = sys.argv[1]
response = os.system("timeout 0.2 ping -c 1 " + hostname)

# and then check the response...
if response == 0:
    print(hostname, 'is up!')
else:
    print(hostname, 'is down!')


